package com.hunliji.monitor.web.job;

import com.hunliji.monitor.web.facade.AdvertiseConsumeFacade;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 5分钟循环执行任务
 * @author wuchen
 */
@JobHandler(value = "fiveMinuteJobHandler")
@Service
public class FiveMinuteJobHandler extends IJobHandler {
    private static final Logger logger = LoggerFactory.getLogger(FiveMinuteJobHandler.class);
    @Resource
    private AdvertiseConsumeFacade advertiseConsumeFacade;
    @Override
    public ReturnT<String> execute(String s) throws Exception {
        logger.info("5分钟循环执行任务被触发");
        advertiseConsumeFacade.logTodayAndYesterdayConsume();
        return null;
    }
}
